import { axios } from '@/utils/request'

//查询所有站点
export function getAllStation (parameter) {
    return axios({
        url: `/bizStation/list`, method: 'get', params: parameter
    })
}

//光纤::声光纤设备统计信息
export function getDasMsg (parameter) {
    return axios({
        url: `/das/getOpticalDeviceStatsInfo`, method: 'get', params: { stationId: parameter }
    })
}

//光纤::声光纤故障统计信息
export function getExceptionMsg (data) {
    return axios({
        url: `/das/getOpticalExceptionInfo`, method: 'get', params: data
    })
}

//光纤::声光纤设备异常信息（月）
/**
 传参：
 {
 "stationId":"162",  //站点id
 "gatewayType":"2",  //网关类型：1-非光纤网关 2-光纤网关
 "startTime":"2023"  //查询时间：年度
 }
 **/
export function getExceptionMonth (data) {
    return axios({
        url: `/das/getErrorGatewayCountByMonth`, method: 'post', data
    })
}

//查询站点下所有设备
export function getAllDevice (parameter) {
    return axios({
        url: `/index/getGatewayAndDeviceInfo?stationId=${parameter}`, method: 'get'
    })
}

//处理信息
export function setInfo (stationId) {
    return axios({
        url: `/index/getExceptionHandleInfo?stationId=${stationId}`, method: 'get'
    })
}

//查询故障日志
// export function defaultInfo (id) {
//     return axios({
//         url: `/index/getDeviceExceptionInfoList?deviceId=${id}`, method: 'get'
//     })
// }

//获取设备异常信息
export function defaultInfo (data) {
    return axios({
        url: 'index/getDeviceExceptionInfoList', method: 'get', params: data
    })
}

//根据文件名获取buffer
export function getBufferByPath (parameter) {
    return axios({
        url: '/index/getBufferByPath', method: 'post', data: parameter
    })
}

//根据文件名获取三表数据
export function getThreeChart (parameter) {
    return axios({
        url: '/index/getData', method: 'post', data: parameter
    })
}

//获取故障模型
export function getModel () {
    return axios({
        url: '/web/api/getFaultModelList', method: 'get'
    })
}

//获取故障月统计
export function getMonthData (id) {
    return axios({
        // url: `/index/getErrorCountByMonth?stationId=${id}`, method: 'get'
        url: `/index/getErrorCountByMonth?stationId=${id}`, method: 'get'
    })
}

//获取健康值
export function getTrendData (id) {
    return axios({
        url: `/index/getExceptionLately?deviceId=${id}`, method: 'get'
    })
}

/**
 * @description 获取故障模型列表
 */
export function getModelList () {
    return axios.post('web/api/getFaultModelList')
}

//根据站点和状态查网关
export function guidePageGateway (parameter) {
    return axios({
        url: '/bizGateway/page', method: 'get', params: parameter
    })
}